{% extends "backEndBase.html" %}

{% block content %}
<div class="container p-3">
    <h2>修改学生信息</h2>
</div>

<div class="container w-75 mb-3">
    <form role="form" action={{url_for("backend.modStu")}} method="post">
        <div class="form-group">
            <label for="trueName">姓名</label>
            <input type="text" class="form-control" id="trueName" name="trueName" placeholder="" value="">
        </div>
        <div class="form-group">
            <label for="schoolId">学号</label>
            <input type="text" class="form-control" id="schoolId" name="schoolId" placeholder="" value="">
        </div>
        <div class="form-group">
            <label for="school">学校</label>
            <input type="text" class="form-control" id="school" name="school" placeholder="" value="">
        </div>
        <div class="form-group">
            <label for="major">专业</label>
            <input type="text" class="form-control" id="major" name="major" placeholder="" value="">
        </div>
        <div class="form-group">
            <label for="userName">用户名</label>
            <input type="text" class="form-control" id="userName" name="userName" placeholder="" value="">
        </div>
        <div class="form-group">
            <label for="passWord">密码</label>
            <input type="password" class="form-control" id="passWord" name="passWord" placeholder="" value="">
        </div>
        <div class="form-group text-center mt-3">
            <input type="submit" class="btn btn-primary" value="修改">
        </div>
    </form>
</div>

<script>
    {% if errorType is equalto 101 %}
        alert("error!");
    {% endif %}
    var nameInput = document.getElementById("trueName");
    var school = document.getElementById("school");
    var schoolId = document.getElementById("schoolId");
    var major = document.getElementById("major");
    var userName = document.getElementById("userName");
    var passWord = document.getElementById("passWord");

    nameInput.value = localStorage.getItem("trueName");
    school.value = localStorage.getItem("school");
    schoolId.value = localStorage.getItem("schoolId");
    major.value = localStorage.getItem("major");
    userName.value = localStorage.getItem("userName");
    passWord.value = localStorage.getItem("passWord");
</script>


{% endblock %}

</html>